﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace EFCore
{
    public class GroupMap : IEntityTypeConfiguration<GroupModel>
    {
        public void Configure(EntityTypeBuilder<GroupModel> builder)
        {
            builder.ToTable("Portal_Group");
            builder.HasKey(a => a.PID);
            builder.Property(a => a.PID).HasColumnName("PID").IsRequired().HasMaxLength(50);
            builder.Property(a => a.GroupName).HasColumnName("GroupName");
            builder.Property(a => a.Code).HasColumnName("Code");
            builder.Property(a => a.ParentID_SelSource).HasColumnName("ParentID_SelSource");
            builder.Property(a => a.GroupUser).HasColumnName("GroupUser");
            builder.Property(a => a.Phone).HasColumnName("Phone");
            builder.Property(a => a.Address).HasColumnName("Address");
            builder.Property(a => a.State_Sel).HasColumnName("State_Sel");
            builder.Property(a => a.Content).HasColumnName("Content");
            builder.Property(a => a.IsHide).HasColumnName("IsHide");
            //数据库自增配置
            builder.Property(a => a.Number).HasColumnName("Number");
            builder.Property(a => a.CreateUser).HasColumnName("CreateUser");
            builder.Property(a => a.CreateTime).HasColumnName("CreateTime");
            builder.Property(a => a.UpdateUser).HasColumnName("UpdateUser");
            builder.Property(a => a.UpdateTime).HasColumnName("UpdateTime");
            builder.Property(a => a.IsDelete).HasColumnName("IsDelete");
        }
    }
}
